<?php
/*
 * @Author: lokei
 * @Date: 2022-09-28 20:55:13
 * @LastEditors: lokei
 * @LastEditTime: 2022-11-15 22:24:25
 * @Description: 
 */
$router->group(['prefix' => env('ROUTER_PREFIX') . 'api'], function () use ($router) {
	
	
	/**SCRM */
	$router->group(['prefix' => 'department'], function () use ($router) {
		// 获取部门列表
		$router->get('list', [
			'as' => 'department/list', 'uses' => '\App\Http\Controllers\Scrm\Department\DepartmentController@list'
		]);
		// 同步企业微信部门
		$router->post('qiwei/sync', [
			'as' => 'syncQiweiDepartment', 'uses' => '\App\Http\Controllers\Scrm\Qiwei\DepartmentController@sync'
		]);
		// 编辑部门
		$router->post('update', [
			'as' => 'updateDepartment', 'uses' => '\App\Http\Controllers\Scrm\Department\DepartmentController@update'
		]);
	});
	$router->group(['prefix' => 'clerk'], function () use ($router) {
		///企业微信
		// 获取部门成员列表
		$router->get('ofDepartment', [
			'as' => 'clerk/ofDepartment', 'uses' => '\App\Http\Controllers\Scrm\Clerk\ClerkController@ofDepartment'
		]);
		// 同步企业微信成员
		$router->post('qiwei/sync', [
			'as' => 'syncQiweiClerk', 'uses' => '\App\Http\Controllers\Scrm\Qiwei\ClerkController@sync'
		]);
		// 编辑企微成员
		$router->post('qiwei/update', [
			'as' => 'updateClerk', 'uses' => '\App\Http\Controllers\Scrm\Qiwei\ClerkController@update'
		]);

		$router->get('get', [
			'as' => 'getClerk', 'uses' => '\App\Http\Controllers\Scrm\Clerk\ClerkController@get'
		]);
		$router->get('list', [
			'as' => 'clerkList', 'uses' => '\App\Http\Controllers\Scrm\Clerk\ClerkController@list'
		]);
		$router->post('update', [
			'as' => 'updateClerk', 'uses' => '\App\Http\Controllers\Scrm\Clerk\ClerkController@update'
		]);
		$router->post('create', [
			'as' => 'createClerk', 'uses' => '\App\Http\Controllers\Scrm\Clerk\ClerkController@create'
		]);
		$router->post('delete', [
			'as' => 'deleteClerk', 'uses' => '\App\Http\Controllers\Scrm\Clerk\ClerkController@delete'
		]);
	});
	$router->group(['prefix' => 'clerk', 'middleware' => 'auth'], function () use ($router) {
		// clerk
		$router->get('ofMe', [
			'as' => 'clerkOfMe', 'uses' => '\App\Http\Controllers\Scrm\Clerk\ClerkController@ofMe'
		]);
	});

	/** 分销 */
	$router->group(['prefix' => 'fx'], function () use ($router) {
		// fx
		$router->get('member/list', [
			'as' => 'fxMemberList', 'uses' => '\App\Http\Controllers\Scrm\Fx\MemberController@list'
		]);
		$router->post('member/pass', [
			'as' => 'passMember', 'uses' => '\App\Http\Controllers\Scrm\Fx\MemberController@pass'
		]);
		$router->post('member/reject', [
			'as' => 'rejectMember', 'uses' => '\App\Http\Controllers\Scrm\Fx\MemberController@reject'
		]);
		$router->post('member/delete', [
			'as' => 'deleteMember', 'uses' => '\App\Http\Controllers\Scrm\Fx\MemberController@delete'
		]);
		$router->get('rule/get', [
			'as' => 'fxRuleGet', 'uses' => '\App\Http\Controllers\Scrm\Fx\RuleController@get'
		]);
		$router->get('rule/list', [
			'as' => 'fxRuleList', 'uses' => '\App\Http\Controllers\Scrm\Fx\RuleController@list'
		]);
		$router->post('rule/create', [
			'as' => 'fxRuleCreate', 'uses' => '\App\Http\Controllers\Scrm\Fx\RuleController@create'
		]);
		$router->post('rule/update', [
			'as' => 'fxRuleUpdate', 'uses' => '\App\Http\Controllers\Scrm\Fx\RuleController@update'
		]);
		$router->post('rule/delete', [
			'as' => 'fxRuleDelete', 'uses' => '\App\Http\Controllers\Scrm\Fx\RuleController@delete'
		]);
		$router->get('follow/ofMember', [
			'as' => 'getFollowOfMember', 'uses' => '\App\Http\Controllers\Scrm\Fx\FollowController@ofMember'
		]);
	});
	$router->group(['prefix' => 'fx', 'middleware' => 'auth'], function () use ($router) {
		// fx
		$router->get('ofMe', [
			'as' => 'fxOfMe', 'uses' => '\App\Http\Controllers\Scrm\Fx\MemberController@ofMe'
		]);
		$router->post('register', [
			'as' => 'fxRegister', 'uses' => '\App\Http\Controllers\Scrm\Fx\MemberController@register'
		]);
	});
	
});
